package com.example.demo.entity.thread;


public class HelloThread extends Thread {
    @Override
    public void run() {
        System.out.println("hello线程启动。。。");
        int n = 0;
        while (!interrupted()) {
            System.out.println("hello " + n);
            n++;
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                System.out.println("hello线程收到中断信号。。。");
                break;
            }
        }
        System.out.println("hello线程执行完毕。。。");
    }
}
